
function onDeleteCat(url, catId, cbo,parent,position)
{
	var isOK = -1;
	
	if(!confirm('Are you sure you want to delete the category with Id:' + catId))
	{
		return false;
	}
	$.ajax({
		   type: "POST",
		   url: url,
		   cache: false,
		   data: 'act=delcat&id=' + catId + '&cat_position='+position+ '&catparent='+parent,
		   success: function(msg){
				var content=msg;
		    	if(content != ""){
					obj = jQuery.parseJSON(content);
	

					if(obj == null)
					{
						$('#ajaxResponse1').innerHTML = 'Something wrong! Reponsed string is: ' + response;
					}
    		
    			isOK = obj.code;
				}
			$('#ajaxResponse1').html(obj.message);
		}
	});

	$('#ajaxResponse1').show();
	$('#'+cbo + '-' + catId).fadeOut(1000, function() {
		// Animation complete.
	  });
	//Fat.fade_element('ajaxResponse1', null, 1500, null, null);

	//if(isOK == 0){
	//	rowID = cbo + '-' + catId;
	//	Fat.fade_element(rowID, null, 1000, "#f22", null);
	//	setTimeout("$(rowID).remove()", 1000);
		
	//}				
}



function onAddSlidePhotos(frId,inputId) {
	var totalId = document.getElementById(inputId);
	var fraddphotos = document.getElementById(frId);
	var divtag = fraddphotos.getElementsByTagName("tr");
	var newvalue = parseInt(totalId.value) +1 ;
	var tr_head = document.createElement("tr");
		fraddphotos.appendChild(tr_head);				
	var th_head = document.createElement("th");
		th_head.width = "33%";
		th_head.scope = "row";
		th_head.valign = "top";
		th_head.innerHTML = 'Image '+newvalue+':';
		tr_head.appendChild(th_head);	
	var td_head = document.createElement("td");
		td_head.width = "67%";
		tr_head.appendChild(td_head);		
	var file_head = document.createElement("input");
		file_head.type = "file";
		file_head.name = "slide_image_"+newvalue;
		td_head.appendChild(file_head);	
		totalId.value = newvalue;
}

function onDeletePhotos(url, photosId,namephoto, resp) {
	var isOK = -1;
	
	if(!confirm('Are you sure you want to delete the Photo with Id:' + photosId)) {
		return false;
	}
	$.ajax({
		   type: "POST",
		   url: url,
		   cache: false,
		   data: 'act=delphoto&id=' + photosId+'&name='+namephoto,
		   success: function(msg){
				var content=msg;
		    	if(content != ""){
		    		obj = jQuery.parseJSON(content);
	

					if(obj == null) {
						$(resp).innerHTML = 'Something wrong! Reponsed string is: ' + response;
					}
				}
    		isOK = obj.code;
			$('#'+resp).html(obj.message);
		}
	});
	$('#'+'photos_one_' + photosId).fadeOut(1000, function() {
		// Animation complete.
	  });
	//$(resp).style.display = 'inherit';
	//Fat.fade_element(resp, null, 1500, null, null);

	//if(isOK == 0) {
	//	rowID = 'photos_one_' + photosId;
	//	Fat.fade_element(rowID, null, 1000, "#f22", null);
	//	setTimeout("$(rowID).remove()", 1000);
	//}				
}